//
//  TMMath.h
//  cutter
//
//  Created by mac on 15/12/31.
//  Copyright © 2015年 e360. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

#ifndef TMMath_h
#define TMMath_h

CGPoint TMPointAdd(CGPoint a, CGPoint b);
CGPoint TMPointSubtract(CGPoint a, CGPoint b);
CGPoint TMPointInterpolate(CGPoint a, CGPoint b, CGFloat s);
CGPoint TMPointBisector(CGPoint a, CGPoint b, CGPoint c);
CGPoint TMPointNormalize(CGPoint v);

CGFloat TMPointDistance(CGPoint a, CGPoint b);
CGFloat TMPointDotProduct(CGPoint a, CGPoint b);
CGFloat TMPointCrossProduct(CGPoint a, CGPoint b);
CGFloat TMPointAngle(CGPoint a, CGPoint b, CGPoint c);
CGFloat TMPointLength(CGPoint v);

Boolean TMPointIntersect(CGPoint a, CGPoint b, CGPoint c, CGPoint d, CGPoint *p, CGFloat *u, CGFloat *v);
Boolean TMPointProject(CGPoint a, CGPoint b, CGPoint p, CGPoint *q);
Boolean TMPointEquals(CGPoint a, CGPoint b);

#endif